https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx61a5ce5230a32e92&redirect_uri=http://yanzheng.ittun.com/open.php&response_type=code&scope=snsapi_base&state=1#wechat_redirect



$appid ="wx61a5ce5230a32e92";
$appsecret ="c04256c9ebe2c5988f26c6322e2b3623";
$code=$_GET["code"];
$didvar="";
$url = "https://api.weixin.qq.com/sns/oauth2/access_token?appid=".$appid."&secret=".$appsecret."&code=".$code."&grant_type=authorization_code";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);
curl_close($ch);
$jsoninfo = json_decode($output, true);
$access_token = $jsoninfo["access_token"];
$opid = $jsoninfo["openid"];


https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx61a5ce5230a32e92&redirect_uri=http://yanzheng.ittun.com/open.php&response_type=code&scope=snsapi_base&state=1#wechat_redirect
